<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include  page="../common/file.jsp"/>
<head>
</head>
<body class="dialog_body">
<form id="submit_form" action="${pageContext.request.contextPath}/organ/update" method="post" target="_parent">
<input type="hidden" id="organId" name="organId" value="${organ.organId }"/>
<div class="dialog-two-div">
	<table class="dialog-two-table">
		<tr>
			<td class="dialog-td-right">单位编号</td>
			<td class="dialog-td-left">
				<input type="text" value="${organ.organId }" readonly="readonly" class="input-readonly"/>
			</td>
		</tr>
		<tr>
			<td class="dialog-td-right">单位名称</td>
			<td class="dialog-td-left">
				<input type="text" id="organName" name="organName" value="${organ.organName }" maxlength="20" placeholder="请输入单位名称" validate="not-null,special-char"/>
				<span class="redtext">*</span>
				<div style="clear:both;display:none"></div>
				<span id="sameOrganName" style="margin-left:0px"></span>
			</td>
		</tr>
		<tr>
			<td class="dialog-td-right">联系人</td>
			<td class="dialog-td-left">
				<input type="text" id="contact" name="contact" value="${organ.contact }" maxlength="12" placeholder="请输入联系人" validate="contact"/>
			</td>
		</tr>
		<tr>
			<td class="dialog-td-right">联系电话</td>
			<td class="dialog-td-left">
				<input type="text" id="telphoneNo" name="telphoneNo" value="${organ.telphoneNo }" maxlength="11" placeholder="请输入联系电话" validate="telephone"/>
			</td>
		</tr>
		<tr>
			<td class="dialog-td-right">邮箱地址</td>
			<td class="dialog-td-left">
				<input type="text" id="email" name="email" value="${organ.email }" maxlength="50" placeholder="请输入邮箱地址" validate="mail"/>
			</td>
		</tr>
	</table>
	<table class="dialog-two-table dialog-table-submit">
		<tr class="dialog-two-button">
			<td colspan=4 >
				<button type="button" class="btn btn-warning submit-btn">提 交</button>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<button type="button" class="btn btn-default cancer-btn" target="_self">返 回</button>
			</td>
		</tr>
	</table>
</div>
</form>
<script type="text/javascript">
	
	//单位名称同名检测
	$('#organName').bind('input propertychange', function() {
		var ctxt = "${pageContext.request.contextPath}";
		var organName = $('#organName').val();
		$.post(ctxt + "/organ/sameCheckOrganName", {"organName": organName}, function(msg) {
			if (msg != undefined && msg.status == "1") {
				$('#sameOrganName').html("<font style='float:left' color='red'>已有相同的单位名称！</font>");
				$('.submit-btn').hide();
			} else {
				$('#sameOrganName').html("");
				$('.submit-btn').show();
			}
		}, "json");
	});
	
	//提交保存
	function submitForm() {
		
		$(".submit-btn").unbind("click");
		$('#submit_form').submit();
		
		return true;
	}
	
	//关闭窗口
	$('.cancer-btn').click(function() {
		art.dialog.close();
	});

</script>
</body>

  
